><

Setting a Variable's Value at Runtime



You may want to assign a certain value to a variable at runtime.

To set up a Set Variable action:

1 Drag the Head Action icon from the Smart tab () of the Objects palette into the head section of the page.

2 In the Action Inspector, choose Test Variable from the Variables submenu of the Action menu.

3 Set the Exec. trigger to OnCall and enter a name for the Set Variable action in the Name text box. This is required if you want to make the Set Variable action accessible at runtime. If you leave the Exec trigger set to the OnLoad default value, the Set Variable action is executed when the page loads and the new value will overwrite your initialization. If you set the trigger to OnUnload, you will not be able to set the variable at runtime because the Set Variable action runs when the browser leaves the page.

4 Choose the variable whose value you want to set from the Variables pop-up menu.

The Value item changes automatically with the type of the variable. Use the appropriate control to supply an initial value, as explained in the preceding section on variable initialization.


Using Actions > Using Adobe GoLive actions > Setting a Variable's Value at Runtime